package Tool;

import Javabean.User;

import javax.swing.*;
import java.util.ArrayList;

public class Function_User_search {
    public Function_User_search(ArrayList<User> users){
        //创建表格列名
        String[] userstablename = { "管理员账号","密码"};
        String[][] userstablevl = Init_User_TableRefresh.usertableRrfersh(users);
        JTable userTable = new JTable(userstablevl,userstablename);

        //创建一个弹框对象
        JDialog jDialog = new JDialog();
        new InitJdialog(jDialog);
        //让弹框居中
        jDialog.setLocationRelativeTo(null);
        jDialog.setTitle("查看管理员");

        //创建滚动面板
        JScrollPane pane = new JScrollPane(userTable);
        pane.setBounds(0,0,550,700);

        //将表格添加到弹框中
        jDialog.getContentPane().add(pane);

        //让弹框显示出来
        jDialog.setVisible(true);
    }
}
